package com.greatwqs.wmall.order.provider.model.dto;

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import lombok.Data;

import java.util.List;

/***
 * 创建订单
 * @author wang-qingsong
 */
@Data
public class OrderCreateDto {

    @NotNull
    @Positive
    private Long userId;

    @NotNull
    @NotEmpty
    @Valid
    private List<OrderProductDto> products;

    @Data
    public static class OrderProductDto {

        @NotNull
        @Positive
        private Long productId;

        @NotNull
        @Positive
        private Integer productNum;
    }
}
